package com.best.onegous.details;


import com.best.onegous.BaseActivity;
import com.best.onegous.Home;
import com.best.onegous.R;
import com.best.onegous.Adapter.RedAdapter;
import com.best.onegous.View.RiseNumberTextView;
import com.best.onegous.fragments.Order_Right;
import com.best.onegous.fragments.Order_left;
import com.best.onegous.fragments.Winning_Right;
import com.best.onegous.fragments.Winning_left;

import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ListView;
import android.widget.TextView;

public class Winning  extends BaseActivity implements OnClickListener{
	private static final String TAG = "NewsFatherFragment";
	//private FragmentManager fManager;
	//private FragmentTransaction transaction;
	private Winning_left left;
	private Winning_Right right;
	private TextView leftbt,rightbt;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setThem(R.layout.winning_activity);
		findViewById(R.id.back).setOnClickListener(this);
		/*fManager = getSupportFragmentManager();
		transaction= fManager.beginTransaction();*/
		leftbt = (TextView) findViewById(R.id.leftbt);
		leftbt.setOnClickListener(this);
		rightbt = (TextView) findViewById(R.id.rightbt);
		rightbt.setOnClickListener(this);
		setItem(true);
	}
	private void setItem(boolean pd){
		FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
		leftbt.setTextColor(getResources().getColor(R.color.a1));
		rightbt.setTextColor(getResources().getColor(R.color.a1));
		if(pd){
			leftbt.setTextColor(getResources().getColor(R.color.them));
			left = Winning_left.newInstance();
			ft.replace(R.id.child_fragment, left,Winning.TAG);
		}else{
			rightbt.setTextColor(getResources().getColor(R.color.them));
			right = Winning_Right.newInstance();
			ft.replace(R.id.child_fragment, right,Winning.TAG);
		}
		ft.commit();
	}
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.back:
			 finish();
			break;
		case R.id.leftbt:
			setItem(true);
			break;
		case R.id.rightbt:
			setItem(false);
			break;
		default:
			break;
		}
	}
}
